import jwt from 'jsonwebtoken'
import {TOKEN_KEY} from '../app/app.config'

interface SignTokenOptions{
    payload:any
}

export const signToken = (options:SignTokenOptions)=>{
    const {payload} = options
    const token = jwt.sign(payload,TOKEN_KEY)
    // console.log(token)
    return token
}